home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 1 December 1996
- // Author: ms
- //
- //
- // Procedure Name:
- // selectionMaskStack
- //
- // Description:
- // The selection mask stack initialization
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
-
- proc string captureSelectionMaskAndPrefs()
- {
- string $command;
-
- // The highlight info:
- $command = ("selectPref -allowHiliteSelection " +
- `selectPref -q -allowHiliteSelection` +
-
- // Affects active:
- " -affectsActive " +
- `selectPref -q -affectsActive` +
-
- // Ignore/Respect selection priorities
- " -ignoreSelectionPriority " +
- `selectPref -q -ignoreSelectionPriority` + "; "
- );
-
- // The select type:
- $command = ( $command + "selectType"
-
- // object selection masks
-
- +" -handle " + `selectType -q -handle`
- +" -ikHandle " + `selectType -q -ikHandle`
-
- +" -joint " + `selectType -q -joint`
-
- +" -nurbsCurve " + `selectType -q -nurbsCurve`
- +" -cos " + `selectType -q -cos`
-
- +" -nurbsSurface " + `selectType -q -nurbsSurface`
- +" -polymesh " + `selectType -q -polymesh`
- +" -subdiv " + `selectType -q -subdiv`
- +" -plane " + `selectType -q -plane`
- +" -stroke " + `selectType -q -stroke`
-
- +" -lattice " + `selectType -q -lattice`
- +" -cluster " + `selectType -q -cluster`
- +" -sculpt " + `selectType -q -sculpt`
- +" -nonlinear " + `selectType -q -nonlinear`
-
- +" -particleShape " + `selectType -q -particleShape`
- +" -emitter " + `selectType -q -emitter`
- +" -field " + `selectType -q -field`
- +" -fluid " + `selectType -q -fluid`
- +" -spring " + `selectType -q -spring`
- +" -rigidBody " + `selectType -q -rigidBody`
- +" -rigidConstraint " + `selectType -q -rigidConstraint`
- +" -collisionModel " + `selectType -q -collisionModel`
-
- +" -light " + `selectType -q -light`
- +" -camera " + `selectType -q -camera`
- +" -texture " + `selectType -q -texture`
-
- +" -ikEndEffector " + `selectType -q -ikEndEffector`
- +" -locator " + `selectType -q -locator`
- +" -dimension " + `selectType -q -dimension`
-
- // component selection masks
-
- +" -cv " + `selectType -q -cv`
- +" -vertex " + `selectType -q -vertex`
- +" -subdivMeshPoint " + `selectType -q -subdivMeshPoint`
- +" -latticePoint " + `selectType -q -latticePoint`
- +" -particle " + `selectType -q -particle`
-
- +" -editPoint " + `selectType -q -editPoint`
- +" -curveParameterPoint " + `selectType -q -curveParameterPoint`
- +" -surfaceParameterPoint " + `selectType -q -surfaceParameterPoint`
- +" -polymeshUV " + `selectType -q -polymeshUV`
-
- +" -polymeshEdge " + `selectType -q -polymeshEdge`
- +" -subdivMeshEdge " + `selectType -q -subdivMeshEdge`
- +" -isoparm " + `selectType -q -isoparm`
- +" -surfaceEdge " + `selectType -q -surfaceEdge`
- +" -surfaceFace " + `selectType -q -surfaceFace`
- +" -springComponent " + `selectType -q -springComponent`
-
- +" -facet " + `selectType -q -facet`
- +" -subdivMeshFace " + `selectType -q -subdivMeshFace`
-
- +" -hull " + `selectType -q -hull`
-
- +" -rotatePivot " + `selectType -q -rotatePivot`
- +" -scalePivot " + `selectType -q -scalePivot`
- +" -jointPivot " + `selectType -q -jointPivot`
-
- +" -selectHandle " + `selectType -q -selectHandle`
-
- +" -localRotationAxis " + `selectType -q -localRotationAxis`
- +" -imagePlane " + `selectType -q -imagePlane`
- +"; "
- );
-
- // The select priority:
- $command = ( $command + "selectPriority"
-
- // object selection masks
-
- +" -handle " + `selectPriority -q -handle`
- +" -ikHandle " + `selectPriority -q -ikHandle`
-
- +" -joint " + `selectPriority -q -joint`
-
- +" -nurbsCurve " + `selectPriority -q -nurbsCurve`
- +" -cos " + `selectPriority -q -cos`
-
- +" -nurbsSurface " + `selectPriority -q -nurbsSurface`
- +" -polymesh " + `selectPriority -q -polymesh`
- +" -subdiv " + `selectPriority -q -subdiv`
- +" -plane " + `selectPriority -q -plane`
- +" -stroke " + `selectPriority -q -stroke`
-
- +" -lattice " + `selectPriority -q -lattice`
- +" -cluster " + `selectPriority -q -cluster`
- +" -sculpt " + `selectPriority -q -sculpt`
- +" -nonlinear " + `selectPriority -q -nonlinear`
-
- +" -particleShape " + `selectPriority -q -particleShape`
- +" -emitter " + `selectPriority -q -emitter`
- +" -field " + `selectPriority -q -field`
- +" -fluid " + `selectPriority -q -fluid`
- +" -spring " + `selectPriority -q -spring`
- +" -rigidBody " + `selectPriority -q -rigidBody`
- +" -rigidConstraint " + `selectPriority -q -rigidConstraint`
- +" -collisionModel " + `selectPriority -q -collisionModel`
-
- +" -light " + `selectPriority -q -light`
- +" -camera " + `selectPriority -q -camera`
- +" -texture " + `selectPriority -q -texture`
-
- +" -ikEndEffector " + `selectPriority -q -ikEndEffector`
- +" -locator " + `selectPriority -q -locator`
- +" -dimension " + `selectPriority -q -dimension`
-
- // component selection masks
-
- +" -cv " + `selectPriority -q -cv`
- +" -vertex " + `selectPriority -q -vertex`
- +" -subdivMeshPoint " + `selectPriority -q -subdivMeshPoint`
- +" -latticePoint " + `selectPriority -q -latticePoint`
- +" -particle " + `selectPriority -q -particle`
-
- +" -editPoint " + `selectPriority -q -editPoint`
- +" -curveParameterPoint " + `selectPriority -q -curveParameterPoint`
- +" -surfaceParameterPoint " + `selectPriority -q -surfaceParameterPoint` +" -polymeshUV " + `selectPriority -q -polymeshUV`
-
- +" -polymeshEdge " + `selectPriority -q -polymeshEdge`
- +" -subdivMeshEdge " + `selectPriority -q -subdivMeshEdge`
- +" -isoparm " + `selectPriority -q -isoparm`
- +" -surfaceEdge " + `selectPriority -q -surfaceEdge`
- +" -surfaceFace " + `selectPriority -q -surfaceFace`
- +" -springComponent " + `selectPriority -q -springComponent`
-
- +" -facet " + `selectPriority -q -facet`
- +" -subdivMeshFace " + `selectPriority -q -subdivMeshFace`
-
- +" -hull " + `selectPriority -q -hull`
-
- +" -rotatePivot " + `selectPriority -q -rotatePivot`
- +" -scalePivot " + `selectPriority -q -scalePivot`
- +" -jointPivot " + `selectPriority -q -jointPivot`
-
- +" -selectHandle " + `selectPriority -q -selectHandle`
-
- +" -localRotationAxis " + `selectPriority -q -localRotationAxis`
- +" -imagePlane " + `selectPriority -q -imagePlane`
- +"; "
- );
-
- return $command;
- }
-
-
- global proc string currentSelectionMask()
- {
- string $command = `captureSelectionMaskAndPrefs`;
-
- // The selectMode:
- if( `selectMode -q -root` ) {
- $command = $command + "selectMode -root; ";
- }
- if( `selectMode -q -leaf` ) {
- $command = $command + "selectMode -leaf; ";
- }
- if( `selectMode -q -template` ) {
- $command = $command + "selectMode -template; ";
- }
- if( `selectMode -q -object` ) {
- $command = $command + "selectMode -object; ";
- }
- if( `selectMode -q -preset` ) {
- $command = $command + "selectMode -preset; ";
- }
- if( `selectMode -q -component` ) {
- $command = $command + "selectMode -component; ";
- }
- if( `selectMode -q -hierarchical` ) {
- $command = $command + "selectMode -hierarchical; ";
- }
-
- return $command;
- }
-
-
- global proc selectionMaskReset()
- //
- // Reset the selection masks to the state they were on startup
- //
- {
- global string $gSelectionMaskInitial;
- eval( $gSelectionMaskInitial );
- }
-
-
- global proc selectionMaskResetAll()
- //
- // Reset the selection masks and the selection mode
- // to the state they were on startup.
- //
- {
- selectionMaskReset();
- selectMode -object;
- }
-
- global proc selectionMaskSaveOnce()
- {
- global string $gSelectionMaskStack;
- if( "" == $gSelectionMaskStack ) {
- $gSelectionMaskStack = `currentSelectionMask`;
- }
- }
-
- global proc selectionMaskRestoreOnce()
- {
- global string $gSelectionMaskStack;
- if( "" != $gSelectionMaskStack ) {
- eval( $gSelectionMaskStack );
- $gSelectionMaskStack = "";
- }
- }
-
- {
- global string $gSelectionMaskStack;
- global string $gSelectionMaskInitial;
-
- $gSelectionMaskInitial = `captureSelectionMaskAndPrefs`;
- $gSelectionMaskStack = "";
-
- scriptJob -permanent -event "NewSceneOpened" "selectionMaskResetAll";
- scriptJob -permanent -event "SceneOpened" "selectionMaskResetAll";
- }
-